A packetizer must provide a public resource of type 'pcki'. The public resource contains information about the capabilities of a given packetizer. This information lists the media types and compression formats the packetizer can work with. It also lists the track characteristics the packetizer can work with, such as layers or transformation matrices. In addition, it provides information about the packetizer's performance characteristics, such as its speed or ability to recover from packet loss.
QuickTime selects the packetizer best suited to the media, compression format, and track characteristics. If there are multiple packetizers that can work with a given track, performance is considered.
For example, one packetizer might be able to pack H.261-compressed video, but be unable to handle any transformation matrix other than identity. Another packetizer might also do H.261 and be able to handle any kind of transformation matrix. If a matrix was being used to scale and translate the media, QuickTime would select the more versatile packetizer. If there were no matrix applied to the track, QuickTime might select the faster packetizer for a live transmission, and the packetizer that dealt best with loss when creating a hint track.
The format of the public resource is defined in QTStreamingComponents.r as follows:
type 'pcki' {
hex longintmediaType;
hex longintdataFormat;
hex longintvendor;
hex longintcapabilityFlags;
byte canPackMatrixType;
byte = 0;
byte = 0;
byte = 0;
longint = $$CountOf(characteristicArray); /* Array size*/
array characteristicArray {
hex longinttag;
hex longint value;
};
hex longintpayloadFlags;
byte payloadID; /* if static payload */
byte = 0;
byte = 0;
byte = 0;
cstring;
};
The first three fields describe the media type, data format (compression format), and the manufacturer. The media type and data format are matched against the given track and media information when deciding whether to use a given packetizer. If your packetizer supports multiple compression formats, set dataFormat to 0. If it supports multiple media types, set mediaType to 0. The vendor field is for informational purposes only.
capabilityFlags can be a combination of:
enum {
kMediaPacketizerCanPackEditRate = 1 << 0,
kMediaPacketizerCanPackLayer = 1 << 1,
kMediaPacketizerCanPackVolume = 1 << 2,
kMediaPacketizerCanPackBalance = 1 << 3,
kMediaPacketizerCanPackGraphicsMode = 1 << 4,
kMediaPacketizerCanPackEmptyEdit = 1 << 5
};
These flags describe a packetizer's ability to deal with track characteristics. By indicating a capability, a packetizer says that it can transmit track information (such as a matrix) to the reassembler on the client side, so that it can be used in the client movie. The specific flags are these:
canPackIdentityMatrixType 0x00
canPackTranslateMatrixType 0x01
canPackScaleMatrixType 0x02
canPackScaleTranslateMatrixType 0x03
canPackLinearMatrixType 0x04
canPackLinearTranslateMatrixType 0x05
canPackPerspectiveMatrixType 0x06
Note that these are the same values as those defined in ImageCompression.h as return values for GetMatrixType. Indicates you can communicate the specified matrix type.
There are two performance characteristics currently defined:
#define kMediaPacketizerSpeedTag 'sped'/* 0-255, 255 is fastest */
#define kMediaPacketizerLossRecoveryTag 'loss'/* 0-255, 0 can't handle any loss, 128 can
handle 50% packet loss */
The speed tag is relative to other packetizers for the same media type and compression format. A value of 128 is a reasonable default.
The payloadFlags field is set to either kRTPMPPayloadTypeDynamicFlag for a dynamic payload type or kRTPMPPayloadTypeStaticFlag for a static payload type.
The payload ID field of the 'pcki' resource is set to the IETF-defined RTP payload value if a static payload type is used.
The C string contains the RTP payload type text if a dynamic payload type is used.
An code example of a resource for a packetizer that supports the 'OVAL' Video compression format follows:
resource 'thnr' (128) {
{
'pcki', 1, 0,
'pcki', 128, cmpResourceNoFlags,
};
};
resource 'pcki' (128) {
'vide', // media type
'OVAL', // data format type
'ABCD', // manufacturer type
kMediaPacketizerCanPackEditRate,
canPackIdentityMatrixType,
{
kMediaPacketizerSpeedTag, 128,
kMediaPacketizerLossRecoveryTag, 50
},
kRTPMPPayloadTypeDynamicFlag,
0,
"OVAL-49545"
};
This packetizer is of medium speed, can handle some loss, can pack any arbitrary play rate, but can't pack any non-identity matrix. Its RTP payload type is a dynamic identifier, identified by the string "OVAL-49545" .
| Previous | Chapter Contents | Chapter Top | Next |